
def myhash():
    hashTable = [""]*4
    mapping = {}

    # 数组添加 O(1)
    hashTable[1] = 'hanmeimei'
    hashTable[2] = 'lihua'
    hashTable[3] = '233'
    mapping[1] = 'hanmeimei'
    mapping[2] = 'lihua'
    mapping[3] = '233'

    # O(1)
    hashTable[1] = 'unspoken'
    mapping[1] = 'erd'

    # O(1)
    hashTable[3] = ''
    mapping.pop(1)  # 删除key=1的值
    # 或者使用del
    del mapping[1]

    # O(1)
    hashTable[3]
    mapping[2]

    # 数组类型的只能遍历
    # 返回true或false  O(1)
    3 in mapping

    # O(1)
    len(mapping)
    # empty?
    len(mapping) == 0

if __name__ == '__main__':
    myhash